﻿<Window x:Class="Stationierung.MainWindow"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:local="clr-namespace:Stationierung"
        Title="Stationierung" Height="420" Width="400" MinWidth="400" MaxWidth="400" MinHeight="420" MaxHeight="800" Icon="/Stationierung;component/Images/Icon_Bagger.ico">
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto"/>
            <RowDefinition/>
        </Grid.RowDefinitions>
        <ListView Name="StationListView" ItemsSource="{Binding Stationen}" Grid.Column="0" Grid.RowSpan="2" Margin="2" VerticalAlignment="Stretch">
            <ListView.View>
                <GridView>
                    <GridViewColumn Width="60" Header="Station" DisplayMemberBinding="{Binding StationsNummer}" />
                    <GridViewColumn Width="60" Header="Breite" DisplayMemberBinding="{Binding Breite}" />
                </GridView>
            </ListView.View>
        </ListView>
        <StackPanel Grid.Column="1" Grid.Row="0"  Margin="10">
            <GroupBox Header="Neue Station">
                <StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="5">
                        <Label Content="Station: " Width="50"/>
                        <TextBox Text="{Binding NewStationNummer,UpdateSourceTrigger=PropertyChanged}" Width="160"/>
                    </StackPanel>
                    <StackPanel Orientation="Horizontal" Margin="5">
                        <Label Content="Breite: " Width="50" />
                        <TextBox Text="{Binding NewStationBreite}" Width="160"/>
                    </StackPanel>
                    <Button Content="Hinzufügen" Command="{Binding AddStationCommand}" Margin="20"/>
                </StackPanel>
            </GroupBox>
            <Button Content="Station Löschen" Command="{Binding DelStationCommand}" CommandParameter="{Binding ElementName=StationListView, Path=SelectedItem}" Margin="25,10,25,10"/>
            <Button Content="Stationen Zurücksetzten" Command="{Binding ResetStationCommand}" CommandParameter="{Binding ElementName=StationListView, Path=Items}" Margin="25,10,25,10"/>
        </StackPanel>
        <StackPanel Grid.Column="1" Grid.Row="1" VerticalAlignment="Bottom"  Margin="10,0,10,10">
            <GroupBox Grid.Column="1" Grid.Row="0" Header="Flächeninhalt gesamt" VerticalAlignment="Bottom">
                <Label Content="{Binding GesamtFläche.Flächeninhalt}" HorizontalAlignment="Center" FontSize="18" FontWeight="Bold" />
            </GroupBox>
            <Label Content="v0.9 © 2011" HorizontalAlignment="Center" Foreground="#77000000" Margin="10" />            
        </StackPanel>
    </Grid>
</Window>
